# 创建 modules 静态库
add_library(modules STATIC
        systemwatch/systemwatch.c
        SubPub/subpub.c 
        DTH11/DTH11.c
        md0280/md0280.c
)

# 设置包含目录
target_include_directories(modules
        PUBLIC
        ${CMAKE_CURRENT_SOURCE_DIR}/systemwatch
        ${CMAKE_CURRENT_SOURCE_DIR}/SubPub
        ${CMAKE_CURRENT_SOURCE_DIR}/DTH11
        ${CMAKE_CURRENT_SOURCE_DIR}/md0280
)

# 链接必要的库
target_link_libraries(modules stm32cubemx ThreadX tools bsp application)

# 将 modules 添加到主项目
target_link_libraries(${PROJECT_NAME} modules)